//////////////////////////////////////////////////////////////
// TITLE: 			Find Constant Panels
//
// DESCRIPTION:
// Determine when MPIDs are in the constant panel monthly and quarterly, done separately for each file
//////////////////////////////////////////////////////////////

use MasterPortfolioId date* using "$output/hd_panels/HD_all_panels_global_Q", clear
drop date_m
format date %tq
bysort MasterPortfolioId date: keep if _n==1
tsset Master date
gen gap=date-l.date
gen constant_sample=1 if gap==1
drop gap
sort MasterPortfolioId date
save "$output/hd_panels/constant_panel_mpids_Q.dta", replace emptyok
